package com.zx.controller.gotos;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;

import javax.servlet.Servlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletRequestWrapper;
import javax.servlet.http.HttpSession;
import java.io.UnsupportedEncodingException;

/**
 * @author sunkai
 * @date 2022/7/26 0026 16:53
 * @mood zhou xun
 * 跳转
 */
@Controller
@RequestMapping("/goto")
public class GotoController {


    @RequestMapping ("/seckill/item/{id}")
    public String gotoSeckillItem(@PathVariable Integer id,Model model){
        model.addAttribute("id",id);
        return "item";
    }


    @GetMapping("/seckill/item/{id}")
    public String  gotoseckillItem(@PathVariable Integer id,Model model){
        model.addAttribute("id",id);
        return "seckill-item";
    }
    @RequestMapping("/query/cart")
    public String gotoCartList(){
        return "cart";
    }
    @GetMapping("/login")
    public String gotoLogin(){
        return "login";
    }


    @RequestMapping("/get/order/info/{cart}")
    public String gotoGetOrderInfo(@PathVariable String cart,Model model){
        model.addAttribute("cart",cart);
        return "getOrderInfo";
    }
}
